// miniprogram/pages/index/index.js
const topBanners = [{
  id: '1',
  picUrl: 'https://liangcang-material.alicdn.com/prod/upload/1dd0b08c628445f2a6c605d7947188d4.jpg?x-oss-process=image/resize,w_1080/format,webp/interlace,1',
  linkUrl: 'https://m.youku.com/alipay_video/id_efae42d0586844258ca4.html?spm=a2hww.12518357.drawer2.dzj1_1'
}, {
  id: '2',
  picUrl: 'https://liangcang-material.alicdn.com/prod/upload/6ce04c1056ea4ae7891f55129d1aa726.jpg?x-oss-process=image/resize,w_1080/format,webp/interlace,1',
  linkUrl: 'https://m.youku.com/alipay_video/id_ffe36e46bc6c46e795b3.html?spm=a2hww.12518357.drawer2.dzj1_4'
}]
const goodsDynamic = [{
  avatarUrl:'https://static.youku.com/user/img/avatar/50/43.jpg',
  nick: '旅梦开发团',
  goodsName: '日式陶瓷米饭碗面碗汤碗韩式家用大碗沙拉碗粥碗创意个性复古餐具'
}, {
  avatarUrl:'https://static.youku.com/lvip/img/avatar/600/11.png',
  nick: '我很六啊',
  goodsName: '办公室三角多层花架桌面工位隔板置物架阳台护栏悬挂式转角收纳架'
}]
const dataList = [{
  id:1,
  title:'五折优惠卷免费领'
},
{
  id:2,
  title:'fhjyyds'
}]
const {categories}=require('../../config/index.js')
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    topBanners,
    goodsDynamic,
    categories,
    noticeList:{
      dataList
    }

  },
  gotoCategory(e){
    let cid = e.currentTarget.dataset.id;
    wx.switchTab({
      url:`/pages/category/category?cid=${cid}`,
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})